fetch('/get_data')
    .then(response => response.json())
    .then(data => {
        console.log(data);  // 打印数据
        const x = data.x;
        const deflections_point = data.deflections_point;
        const deflections_dist = data.deflections_dist;

        Plotly.newPlot(plotDiv, [
            { x: x, y: deflections_point, name: '集中荷载', type: 'scatter' },
            { x: x, y: deflections_dist, name: '均布荷载', type: 'scatter' }
        ], layout);
    })
    .catch(error => console.error('Error fetching data:', error));